package com.luoqiz.feign.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.luoqiz.common.httpEntity.PageResponse;
import com.luoqiz.common.testEntity.Member;
import com.luoqiz.feign.service.SystemServiceFeign;

@RestController
@RequestMapping("feign")
public class FeignController {

	@Autowired
	private SystemServiceFeign systemServiceFeign;

	@GetMapping("reflect")
	private List<Member> getMember(@RequestParam(defaultValue = "5") int length) {
		PageResponse<Integer, List<Member>> rs = systemServiceFeign.listMember(length);
		return rs.getData();
	}

	@GetMapping("string")
	private String getUsername(String username) {
		String rs = systemServiceFeign.getdict(username);
		return rs;
	}

}
